package com.shangxian.giveithome.mapper;


import com.shangxian.giveithome.entity.Place;
import com.shangxian.giveithome.entity.PlaceCreate;
import com.shangxian.giveithome.entity.PlaceUpdate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PlaceMapper {
    /**
     * 获取待送养总数
     *
     * @param id
     * @return
     */
    Integer countByUsAPlace(Long id);

    /**
     * 获取送养-历史总数
     *
     * @param id
     * @return
     */
    Integer countByUsAPlaceHistory(Long id);

    /**
     * 获取待送养数据
     *
     * @param id
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<Place> queryByPlaceUs(@Param("id") Long id, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    /**
     * 获取送养-历史数据
     *
     * @param id
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<Place> queryByPlaceHistoryUs(@Param("id") Long id, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    /**
     * 保存从收容过来的领养数据
     * @param place
     */
    void saveAsylum(Place place);

    Integer queryByAsylum(@Param("along") Long aLong, @Param("id") Long id);

    void delete(@Param("along") Long aLong, @Param("id") Long id);

    List<Place> queryByPlaces(@Param("collect") List<Long> collect, @Param("status") Integer status);

    Place queryByDetails(Long id);

    void savePlace(PlaceCreate petCreate);

    void updatePlace(PlaceUpdate placeUpdate);

    Place querySimPlaceById(@Param("petId")Long petId, @Param("status") Integer status);

    int updateStatus(@Param("petId")Long petId, @Param("curStatus")Integer curStatus, @Param("status")Integer status);

    int queryCountPlaceMe(Long id);

    void deleteUsPet(@Param("petId") Long petId, @Param("usId") Long usId);
}
